<template>
	<div class="banner">
		<el-carousel :interval="1000"  arrow="always" height="390px">
			<el-carousel-item v-for="item in homelist" :key="item.id">
				<img :src="`/api/public/showimg/`+item.picture" />
			</el-carousel-item>
		</el-carousel>
	</div>
</template>

<script>
	export default {
		name: "HomeSwiper",
		data() {
			return {
				homelist: [],
			}
		},
		created() {
			this.$axios.get('/api/public/findHot/' + 1 + '/' + 6).then((res) => {
				if (res.status == 200) {
					this.homelist = res.data.data
				}
			}).catch((error) => {
				console.log(error);
			})
		}

	}
</script>

<style scoped>
	.banner {
		width: 45%;
		height: 400px;
	}

	.banner img {
		position: absolute;
		width: 100%;
		height: inherit;
	}


</style>